<?php

/*
File: compbuild.php
Version: 2.0
Date created: 
Last Edited : 26-07-2008
Author: Craig G Smith<craig@joomla-host.co.za
*/

  defined( 'JOSCOM_VERSION' ) or die( 'Direct Access to this location is not allowed.' );
  if (defined( '_OSCOMMERCE_LOADED' )) {
    if (!DB_SHARED) {
      tep_db_connect() or die('Unable to connect to database server!');
    }
    global $category_links, $languages_id, $cPath, $cPath_array, $current_category_id;
    global $request_type, $lng, $cart, $currencies, $language, $navigation, $breadcrumb;
  } else {
    require(DIR_WS_COMPONENT . 'includes/application_top.php');
  }

  
  require(DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();
  
  //sorts out the globals issue, the quick way
  foreach($_POST as $key => $value){
  $$key = $value;
  }

  $action = (isset($_REQUEST['action']) ? $_REQUEST['action'] : '');
   if (tep_not_null($action)) {
    switch ($action) {


      case 'update':

           if( mysql_num_rows(mysql_query("SHOW TABLES LIKE '".DB_PREFIX."compbuild_options'"))!=1){
// create tables if they dont exist

//create options table
$result1 = tep_db_query("CREATE TABLE `".DB_PREFIX."compbuild_options` (
	`pc_system_id` INT( 11 ) NOT NULL ,
	`pc_system_name` VARCHAR(255) NOT NULL ,
	`pc_system_image` VARCHAR(255) NOT NULL ,
	`pc_system_language` INT( 11 ) NOT NULL ,
	`pc_system_assembly` DECIMAL( 4,2 ) NOT NULL ,
	`pc_template` INT( 11 ) NOT NULL ,
	`pc_use_osc_cart` INT( 11 ) NOT NULL ,
	`pc_add_tax` INT( 11 ) NOT NULL ,
	`pc_use_dependence` INT( 11 ) NOT NULL ,
	`pc_use_software` INT( 11 ) NOT NULL ,
	`pc_currency` VARCHAR( 255 ) NOT NULL
);");
$result2 = tep_db_query("INSERT INTO `".DB_PREFIX."compbuild_options` (
`pc_system_id`,`pc_system_name`,`pc_system_image`,`pc_system_language`,`pc_system_assembly`,`pc_template`,`pc_use_osc_cart`, `pc_add_tax` , `pc_use_dependence`,`pc_use_software`,`pc_currency`)
VALUES ( '1' , 'Desktop' , 'noimg.gif' , '0' , '0.00' , '2' , '0' , '0' , '0' , '0' , 'USD');");

//create categories table
$result3 = tep_db_query("CREATE TABLE `".DB_PREFIX."compbuild_categories` (
	`pc_category_id` INT( 11 ) NOT NULL ,
	`pc_category_name` VARCHAR( 32 ) NOT NULL ,
	`pc_category_image` VARCHAR( 32 ) NOT NULL ,
	`osc_category_id` INT( 11 ) NOT NULL ,
	`pc_depends_on` INT( 11 ) NOT NULL ,
	`pc_system_id` INT( 11 ) NOT NULL ,
	`pc_preset_ids` INT( 11 ) NOT NULL ,
	`pc_language` INT( 11 ) NOT NULL
);");
$result4 = tep_db_query("INSERT INTO `".DB_PREFIX."compbuild_categories` (
 `pc_category_id` , `pc_category_name` , `pc_category_image`, `osc_category_id` , `pc_depends_on` , `pc_system_id`, `pc_preset_ids`, `pc_language` )
VALUES ( '1' , 'CPU' , 'noimg.gif' , '0', '0', '0', '0', '0');");
$result5 = tep_db_query("INSERT INTO `".DB_PREFIX."compbuild_categories` (
 `pc_category_id` , `pc_category_name` , `pc_category_image`, `osc_category_id` , `pc_depends_on` , `pc_system_id`, `pc_preset_ids`, `pc_language` )
VALUES ( '2' , 'MotherBoard' , 'noimg.gif' , '0', '0', '0', '0', '0');");
$result6 = tep_db_query("INSERT INTO `".DB_PREFIX."compbuild_categories` (
 `pc_category_id` , `pc_category_name` , `pc_category_image`, `osc_category_id` , `pc_depends_on` , `pc_system_id`, `pc_preset_ids`, `pc_language` )
VALUES ( '3' , 'DDR Ram' , 'noimg.gif' , '0', '0', '0', '0', '0');");


if (($result1 == 1)&($result2 == 1)&($result3 == 1)&($result4 == 1)&($result5 == 1)&($result6 == 1)){
$messageStack->add_session("Database Tables Created successfully", 'success'); }
 else {  $messageStack->add_session("The Database Tables could not be created!", 'error'); }
$result1 =""; $result2 =""; $result3 =""; $result4 =""; $result5 =""; $result6 ="";

   } else {

// update the tables if they already exist
if ($pc_currency == "") { $pc_currency = "USD"; }
// update options table


// update system options
$cbcomp_query = tep_db_query("select * from `".DB_PREFIX."compbuild_options`");
 while ($cbcomp = tep_db_fetch_array($cbcomp_query)){
	if (($pc_system_id != "")&($pc_system_id != $cbcomp['pc_system_id'])) { tep_db_query("UPDATE 	`".DB_PREFIX."compbuild_options` SET pc_system_id ='".$pc_system_id."' WHERE pc_system_id ='".$cbcomp['pc_system_id']."'"); }
	if (($pc_system_name != "")&($pc_system_name != $cbcomp['pc_system_name'])) { tep_db_query("UPDATE `".DB_PREFIX."compbuild_options` SET pc_system_name ='".$pc_system_name."' WHERE pc_system_name ='".$cbcomp['pc_system_name']."'"); }
	if (($pc_system_image != "")&($pc_system_image != $cbcomp['pc_system_image'])) { tep_db_query("UPDATE `".DB_PREFIX."compbuild_options` SET pc_system_image ='".$pc_system_image."' WHERE pc_system_image ='".$cbcomp['pc_system_image']."'"); }
	if (($pc_system_language != "")&($pc_system_language != $cbcomp['pc_system_language'])) { tep_db_query("UPDATE `".DB_PREFIX."compbuild_options` SET pc_system_language ='".$pc_system_language."' WHERE pc_system_language ='".$cbcomp['pc_system_language']."'"); }
	if (($pc_system_assembly != "")&($pc_system_assembly != $cbcomp['pc_system_assembly'])) { tep_db_query("UPDATE `".DB_PREFIX."compbuild_options` SET pc_system_assembly ='".$pc_system_assembly."' WHERE pc_system_assembly ='".$cbcomp['pc_system_assembly']."'"); }
	if (($pc_template != "")&($pc_template != $cbcomp['pc_template'])) { tep_db_query("UPDATE `".DB_PREFIX."compbuild_options` SET pc_template ='".$pc_template."' WHERE pc_template ='".$cbcomp['pc_template']."'"); }
	if (($pc_use_osc_cart != "")&($pc_use_osc_cart != $cbcomp['pc_use_osc_cart'])) { tep_db_query("UPDATE `".DB_PREFIX."compbuild_options` SET pc_use_osc_cart ='".$pc_use_osc_cart."' WHERE pc_use_osc_cart ='".$cbcomp['pc_use_osc_cart']."'"); }
	if (($pc_add_tax != "")&($pc_add_tax != $cbcomp['pc_add_tax'])) { tep_db_query("UPDATE `".DB_PREFIX."compbuild_options` SET pc_add_tax ='".$pc_add_tax."' WHERE pc_add_tax ='".$cbcomp['pc_add_tax']."'"); }
	if (($pc_use_dependence != "")&($pc_use_dependence != $cbcomp['pc_use_dependence'])) { tep_db_query("UPDATE `".DB_PREFIX."compbuild_options` SET pc_use_dependence ='".$pc_use_dependence."' WHERE pc_use_dependence ='".$cbcomp['pc_use_dependence']."'"); }
	if (($pc_use_software != "")&($pc_use_software != $cbcomp['pc_use_software'])) { tep_db_query("UPDATE `".DB_PREFIX."compbuild_options` SET pc_use_software ='".$pc_use_software."' WHERE pc_use_software ='".$cbcomp['pc_use_software']."'"); }
	if (($pc_currency != "")&($pc_currency != $cbcomp['pc_currency'])) { tep_db_query("UPDATE `".DB_PREFIX."compbuild_options` SET pc_currency ='".$pc_currency."' WHERE pc_currency ='".$cbcomp['pc_currency']."'"); }
}


// update category options from settings tab
$pcount=0;
$pbcomp_query = tep_db_query("select * from `".DB_PREFIX."compbuild_categories` ORDER BY pc_category_id");
 while ($pbcomp = tep_db_fetch_array($pbcomp_query)){
$temp = $pbcomp['pc_category_name'];
$temp2 = ${editid.$pcount};
$temp3 = ${editdepend.$pcount};
$temp4 = ${editoscat.$pcount};
$temp5 = ${editimage.$pcount};
if ($temp2 != $pbcomp['pc_category_id']) { $did_update = 1; tep_db_query("UPDATE `".DB_PREFIX."compbuild_categories` SET pc_category_id ='".$temp2."' WHERE pc_category_name ='".$temp."'"); }
if ($temp3 != $pbcomp['pc_depends_on']) { $did_update = 1; tep_db_query("UPDATE `".DB_PREFIX."compbuild_categories` SET pc_depends_on ='".$temp3."' WHERE pc_category_name ='".$temp."'"); }
if ($temp4 != $pbcomp['osc_category_id']) { $did_update = 1; tep_db_query("UPDATE `".DB_PREFIX."compbuild_categories` SET osc_category_id ='".$temp4."' WHERE pc_category_name ='".$temp."'"); }
if ($temp5 != $pbcomp['pc_category_image']) { $did_update = 1; tep_db_query("UPDATE `".DB_PREFIX."compbuild_categories` SET pc_category_image ='".$temp5."' WHERE pc_category_name ='".$temp."'"); }
if ($did_update == 1) { $did_update = ""; $messageStack->add_session("Category $temp updated successfully", 'success');   }
 $pcount++;
}

// Add new row
if( $newrow != "") { $result1 = tep_db_query("INSERT INTO `".DB_PREFIX."compbuild_categories` (
`pc_category_id` , `pc_category_name` , `pc_category_image` , `osc_category_id`, `pc_depends_on` , `pc_system_id` , `pc_preset_ids` , `pc_language` ) VALUES ('".$neworder."' , '".$newrow."' , '$newimage' , '$newoscat' , '0' , '0' , '0' , '0');");
if ($result1 == 1) { $messageStack->add_session("New Row $newrow added successfully", 'success'); }
else { $messageStack->add_session("New Row $newrow Not added! Database Error", 'error'); }
$result1 = "";
$newrow = "";
   }

// Remove row
if( $delrow != "") { $result1 = tep_db_query("DELETE FROM `".DB_PREFIX."compbuild_categories` WHERE pc_category_name = '".$delrow."'");
if ($result1 == 1) { $messageStack->add_session("Row $delrow removed successfully", 'success'); }
else { $messageStack->add_session("Row $delrow Not removed! Database Error", 'error'); }
$result1 = "";
$delrow = "";
   }

// Rename row
if( $fromrow != "" && ( $torow != "" )) { $result1 = tep_db_query("UPDATE `".DB_PREFIX."compbuild_categories` SET pc_category_name ='".$torow."' WHERE pc_category_name ='".$fromrow."'");
if ($result1 == 1) { $messageStack->add_session("Row $fromrow renamed to $torow successfully", 'success'); }
else { $messageStack->add_session("Row $fromrow NOT renamed to $torow! Database Error", 'error'); }
$result1 = "";
$fromrow = "";
$torow = "";
   }
}
       tep_redirect(tep_href_link('compbuild.php'));
       break;
      }
}
// Case Update End
// Case End


// Main Page Start

// check if the cache directory exists
  if (is_dir(DIR_FS_CACHE)) {
    if (!is_writeable(DIR_FS_CACHE)) $messageStack->add(ERROR_CACHE_DIRECTORY_NOT_WRITEABLE, 'error');
  } else {
    $messageStack->add(ERROR_CACHE_DIRECTORY_DOES_NOT_EXIST, 'error');
  }
  
  $languages = tep_get_languages();
  $languages_array = array();
  $languages_selected = DEFAULT_LANGUAGE;
  for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
    $languages_array[] = array('id' => $languages[$i]['code'],
                               'text' => $languages[$i]['name']);
    if ($languages[$i]['directory'] == $language) {
      $languages_selected = $languages[$i]['code'];
    }
  }

?>

<link rel="stylesheet" type="text/css" href="<?php echo DIR_WS_COMPONENT ?>includes/stylesheet.css">
	<script type="text/javascript" src="<?php echo DIR_WS_COMPONENT ?>includes/javascript/ajax.js"></script>
	<script type="text/javascript" src="<?php echo DIR_WS_COMPONENT ?>includes/javascript/tab-view.js"></script>
	
<style type="text/css">
<!--
.inputbox {
        color: blue;
        background: #FCFCFE;
        font-family: Courier, Helvetica, sans-serif;
        z-index: -3;
        font-size: 11px;
}
-->
</style>

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->

<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
    </table></td>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>

<?php echo tep_draw_form('compbuild', tep_href_link('compbuild.php', tep_get_all_get_params(array('action')) . '&action=update'), 'post', ''); ?>

<?php
// Get info from OSC categories discription table
 $count=0;
 $c_query = tep_db_query("select categories_name,categories_id from " . TABLE_CATEGORIES_DESCRIPTION . " where language_id ='".(int)$languages_id."' ORDER BY categories_id");
 while ($c_value = tep_db_fetch_array($c_query)){
 $category['name'][$count]=$c_value['categories_name'];
 $category['id'][$count]=$c_value['categories_id'];
 $count++;
 }
// Get info from OSC categories table
 $count=0;
 $c_query = tep_db_query("select categories_id,parent_id from " . TABLE_CATEGORIES . " ORDER BY categories_id");
 while ($c_value = tep_db_fetch_array($c_query)){
        if ($c_value['parent_id'] != "0") { $category['name'][$count] = "--".$category['name'][$count]; }
 $count++;
 }

//be sure the tables already exist
           if( mysql_num_rows(mysql_query("SHOW TABLES LIKE '".DB_PREFIX."compbuild_categories'"))==1){


//get options
$cbcomp_query = tep_db_query("select * from `".DB_PREFIX."compbuild_options`");
 while ($cbcomp = tep_db_fetch_array($cbcomp_query)){
$pc_system_id= $cbcomp['pc_system_id'];
$pc_system_name= $cbcomp['pc_system_name'];
$pc_system_image= $cbcomp['pc_system_image'];
$pc_system_language= $cbcomp['pc_system_language'];
$pc_system_assembly= $cbcomp['pc_system_assembly'];
$pc_template= $cbcomp['pc_template'];
$pc_use_osc_cart= $cbcomp['pc_use_osc_cart'];
$pc_add_tax= $cbcomp['pc_add_tax'];
$pc_use_dependence= $cbcomp['pc_use_dependence'];
$pc_use_software= $cbcomp['pc_use_software'];
$pc_currency= $cbcomp['pc_currency'];
}

//get categories
 $pcount=0;
     $bcomp_query = tep_db_query("select * from `".DB_PREFIX."compbuild_categories` ORDER BY pc_category_id");
 while ($bcomp = tep_db_fetch_array($bcomp_query)){
$pcid[$pcount]= $bcomp['pc_category_id'];
$pccat[$pcount]= $bcomp['pc_category_name'];
$pcimg[$pcount]= $bcomp['pc_category_image'];
$osccat[$pcount]= $bcomp['osc_category_id'];
$pcdep[$pcount]= $bcomp['pc_depends_on'];
$msys_id[$pcount]= $bcomp['pc_system_id'];
$presets[$pcount]= $bcomp['pc_preset_ids'];
$pclang[$pcount]= $bcomp['pc_language'];
 $pcount++; }
} else { $messageStack->add_session("Click Update to Create the DB Tables", 'error'); }
?>

<div align="center">

<table width="100%" border="0">
  <tr>
    <td valign="middle" align="left">

<div id="dhtmlgoodies_tabView1">
	<div class="dhtmlgoodies_aTab">

<!-- Settings Tab Start -->

<div class="tab" id="tab1"><h2 class="tab"><?php echo SETTINGS; ?></h2>
<table class="adminform">
<tr><b><center><?php echo SET_DISP_ORDER; ?></center></b></tr>
<td  width="50%">
<table valign="top" bgcolor="#CFDFEF" border="1">
<tr bgcolor="#95C1FA" class="main"><td width="65"><?php echo BUILDER_CAT; ?></td><td width="8"><?php echo DISPLAY_ORDER; ?></td><td width="10"><?php echo IMAGE_NAME; ?></td><td width="50%"><?php echo PRODUCTS_CATEGORY; ?></td></tr>

<?php
// build settings tab
$output = $pcount;
$half = round($output / 2);// divide output to split tables, round off remainder
$half -=($output % 2);// subtract remainder to even up the table split
for ($i = 0; $i < $output; $i++) {
echo '<tr><td class="smallText"><b>';
echo '<FONT color=#1419FE><center><nobr>'.$pccat[$i].'&nbsp&nbsp;</nobr></center></FONT></b></td>';
echo '<td><input type="text" name="editid'.$i.'" value="'.$pcid[$i].'" size="2"></td>';
echo '<td><input type="text" name="editimage'.$i.'" value="'.$pcimg[$i].'" size="6"></td>';
echo '<input type="hidden" name="editdepend'.$i.'" value="0">';
echo '<td class="main">';
echo tep_draw_pull_down_menu('editoscat'.$i, tep_get_category_tree(0, '', '0', '', false), $osccat[$i]);
echo '</td></tr>'."\n";

if ($i == $half) { echo '</table></td><td width="50%"><table valign="top" bgcolor="#CFDFEF" border="1"><tr bgcolor="#95C1FA" class="main"><td width="65">Builder Category</td><td width="8">Display Order</td><td width="10">Image Name</td><td width="50%">Products Category</td></tr>'; }
}
?>
   </table></td></table>
<table bgcolor="#95C1FA" width="100%" border="0">
<tr><td>&nbsp;</td></tr>
</table>

<!--Add Catagory Start-->
<table bgcolor="#CFDFEF" width="50%" border="1">

<tr class="main" align="left">
<td width="5"><B><?php echo ADD_NEW_CAT;?>: </B></td>
<td><?php echo DISPLAY_ORDER;?>: &nbsp;&nbsp; <input type="text" name ="neworder" value="<?php echo ($pcount+1); ?>" size="2"><br/><?php echo IMAGE_NAME;?>: &nbsp; &nbsp; <input type="text" name ="newimage" value="noimg.gif" size="8"><?php echo IMAGE_PATH_MSG; ?><br/><?php echo BUILDER_CAT;?>:&nbsp; &nbsp; <input type="text" name ="newrow"><br/>
<?php echo PRODUCTS_CATEGORY; ?>
: &nbsp;&nbsp; <?php echo tep_draw_pull_down_menu('newoscat', tep_get_category_tree(0, '', '0', '', false));?>
</td></tr>
<tr class="main" align="left">
<td width="5"><B><?php echo REMOVE_CAT;?>: </B></td>
<td> <?php echo CAT_NAMED;?>: <input type="text" name ="delrow"></td></tr>
<tr class="main" align="left">
<td width="5"><B><?php echo RENAME_CAT;?>: </B></td>
<td> <?php echo CAT_FROM;?>: <input type="text" name ="fromrow"><br/><?php echo CAT_TO;?>:  &nbsp; &nbsp; <input type="text" name ="torow"></td></tr>
</table>
<!--Add Catagory End-->
        </div>

<!-- Settings Tab End -->

</div>

<div class="dhtmlgoodies_aTab">
<div class="tab" id="tab2"><h2 class="tab"><?php echo GLOBALS; ?></h2>
        <table class="adminform">

  

      <tr>
        <td class="smallText"><b>Language:</td>
        <td class="smallText"><b>
<?php echo tep_draw_pull_down_menu('language', $languages_array, $languages_selected, ''); ?></b><font color=orange></td>
      </tr>

       <tr>
        <td class="smallText"><b><?php echo GLOBALS_PC_TEMPLATE; ?></td>
        <td class="smallText"><b><select name="pc_template">
        <option value="1">Default</option>
        <option value="2"<?php if ($pc_template==2)echo "selected";?>>Blue Version</option>
        </select>
<?php
$pc_templatefile = DIR_FS_CATALOG."build/builder".$pc_template.".js";
if (file_exists($pc_templatefile)) { echo "<font color=green>".TEMPLATE_EXIST ; } else { 
echo tep_image(DIR_WS_IMAGES . 'warning.png', '');
echo "  </b><font color=red>".TEMPLATE_NOT_EXIST ; } ?>
        </td>
      </tr>








       <tr>
        <td class="smallText"><b><?php echo GLOBALS_DEPEND; ?></td>
        <td class="smallText"><b>  <input type="radio" name="pc_use_dependence" value="0" checked="checked" class="inputbox"  /><?php echo NO;?>
        <input type="radio" name="pc_use_dependence" value="1" <?php if ($pc_use_dependence==1)echo 'checked="checked"';?> class="inputbox" selected /><?php echo YES;?>
          </td>
      </tr>
      <tr>
        <td class="smallText"><b><?php echo GLOBALS_OSCOM; ?></td>
        <td class="smallText"><b>  <input type="radio" name="pc_use_osc_cart" value="0" checked="checked" class="inputbox"  /><?php echo NO;?>
        <input type="radio" name="pc_use_osc_cart" value="1" <?php if ($pc_use_osc_cart==1)echo 'checked="checked"';?> class="inputbox"  /><?php echo YES;?>
&nbsp;

<?php if (!$pc_use_osc_cart) echo tep_image(DIR_WS_IMAGES . 'warning.png', '') . "  </b><font color=orange>".GLOBALS_OSCOM2;?>

          </td>
      </tr>


       <tr>
        <td class="smallText"><b>Add Tax in Builder</td>
        <td class="smallText"><b>  <input type="radio" name="pc_add_tax" value="0" checked="checked" class="inputbox"  /><?php echo NO;?>
        <input type="radio" name="pc_add_tax" value="1" <?php if ($pc_add_tax==1)echo 'checked="checked"';?> class="inputbox" selected /><?php echo YES;?>
          </td>
      </tr>


       <tr>
        <td class="smallText"><b>Assembly Fee</td>
        <td class="smallText"><b>  <input type="text" name="pc_system_assembly" value="<?php echo $pc_system_assembly; ?>" size="10"/>
          </td>
      </tr>



    </table>
        </div></div>

<!-- Global Tab End -->

<!-- About tab start -->
<div class="dhtmlgoodies_aTab">
<div>
<h2 class="tab">About</h2>

  <table class="adminform">
    <td width="100%" valign="top" align="center"><table border="0" width="100%" cellspacing="0" cellpadding="2" align="center">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0" align="center">
          <tr>
            <td class="pageHeading" align="center">Build Custom Computer</td>
            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
           </tr>
          <tr>
           <td class="main" align="center" valign="top">Based on the Oscommerce Open Source addon for building a custom computer.<br></td>
           </tr>
           <tr>
           <td class="main" align="center" valign="top"><br></td>
           </tr>
                <tr>
                    <td align=center valign=top><?php echo tep_image(DIR_WS_IMAGES . 'addon.gif', '');?>
                    </td>
           <tr><td align=center valign=top><font class=small color=#FFA500> <a href='http://www.misron.co.il' color=#FFA500 target=_blank><font color=#FFA500>misron.co.il</a></font></td>

          </tr>
        </table></td>
      </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
    </table></td>

  </tr>
</table>
        </div>
</div>
</div>
</div>
<script type="text/javascript">
initTabs('dhtmlgoodies_tabView1',Array(' Settings ',' Global ',' About '),0,'100%','',Array(false,false,false));
</script>
<!-- About tab end -->

<!-- Buttons Start -->

<table width=90%>
 <tr>
        <td align="center" class="main">
<?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('action'))) .'">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?>
</td>
      </tr></form>
              </table>

<!-- Buttons End -->

</td>
          </tr>
        </table></td>
      </tr>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->
<!-- footer //-->

<?php


 require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
<?php
  require(DIR_WS_INCLUDES . 'application_bottom.php');

  // -- webMS Modification --
  // reset the Mambo Database connection (stomped by osCommerce Connection)
  if (!DB_SHARED) {
    global $database, $mosConfig_host, $mosConfig_user, $mosConfig_password, $mosConfig_db, $mosConfig_dbprefix;
    $database = new database( $mosConfig_host, $mosConfig_user, $mosConfig_password, $mosConfig_db, $mosConfig_dbprefix );
  }
?>